package com.ruoyi.business.enums;

import java.util.Arrays;
import java.util.Optional;

public enum DealEnum {
    DEAL_FINAL(1,"已处理") ,
    WAITING_DEAL(0,"未处理") ;
    private Integer code ;
    private String desc ;

    DealEnum(int code,String desc){
        this.code = code ;
        this.desc = desc ;
    }

    public static boolean checkExist(int code){

        Optional<DealEnum> dealOp = Arrays.stream(DealEnum.values()).filter(deal -> deal.code == code).findFirst() ;
        return dealOp.isPresent() ;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
